/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tv.inventario.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "STTDEH", schema = "dbo")
public class Deposito implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "STTDEH_DEPOSI", nullable = false, length = 15)
    private String deposi;
    @Basic(optional = false)
    @Column(name = "STTDEH_DESCRP", nullable = false, length = 60)
    private String descrp;
    @Basic(optional = false)
    @Column(name = "STTDEH_DIRECC", nullable = false, length = 60)
    private String direcc;
    @Column(name = "STTDEH_CODPAI", length = 3)
    private String codpai;
    @Column(name = "STTDEH_CODPOS", length = 10)
    private String codpos;
    @Basic(optional = false)
    @Column(name = "STTDEH_TIPDEP", nullable = false, length = 1)
    private String tipdep;
    @Basic(optional = false)
    @Column(name = "STTDEH_SIGNOS", nullable = false, length = 1)
    private String signos;
    @Column(name = "STTDEH_CNDIVA", length = 6)
    private String cndiva;
    @Column(name = "STTDEH_TIPDOC", length = 4)
    private String tipdoc;
    @Column(name = "STTDEH_NRODOC", length = 50)
    private String nrodoc;
    @Basic(optional = false)
    @Column(name = "STTDEH_DEPFIS", nullable = false)
    private char depfis;
    @Column(name = "STTDEH_DEBAJA")
    private Character debaja;

    @OneToMany(mappedBy="deposito", fetch=FetchType.LAZY)
    private List<Sector> sectores;

    public Deposito() {
    }

    public Deposito(String deposi) {
        this.deposi = deposi;
    }

    public Deposito(String deposi, String descrp, String direcc, String tipdep, String signos, char depfis) {
        this.deposi = deposi;
        this.descrp = descrp;
        this.direcc = direcc;
        this.tipdep = tipdep;
        this.signos = signos;
        this.depfis = depfis;
    }

    public String getCndiva() {
        return cndiva;
    }

    public void setCndiva(String cndiva) {
        this.cndiva = cndiva;
    }

    public String getCodpai() {
        return codpai;
    }

    public void setCodpai(String codpai) {
        this.codpai = codpai;
    }

    public String getCodpos() {
        return codpos;
    }

    public void setCodpos(String codpos) {
        this.codpos = codpos;
    }

    public Character getDebaja() {
        return debaja;
    }

    public void setDebaja(Character debaja) {
        this.debaja = debaja;
    }

    public char getDepfis() {
        return depfis;
    }

    public void setDepfis(char depfis) {
        this.depfis = depfis;
    }

    public String getDeposi() {
        return deposi;
    }

    public void setDeposi(String deposi) {
        this.deposi = deposi;
    }

    public String getDescrp() {
        return descrp;
    }

    public void setDescrp(String descrp) {
        this.descrp = descrp;
    }

    public String getDirecc() {
        return direcc;
    }

    public void setDirecc(String direcc) {
        this.direcc = direcc;
    }

    public String getNrodoc() {
        return nrodoc;
    }

    public void setNrodoc(String nrodoc) {
        this.nrodoc = nrodoc;
    }

    public String getSignos() {
        return signos;
    }

    public void setSignos(String signos) {
        this.signos = signos;
    }

    public String getTipdep() {
        return tipdep;
    }

    public void setTipdep(String tipdep) {
        this.tipdep = tipdep;
    }

    public String getTipdoc() {
        return tipdoc;
    }

    public void setTipdoc(String tipdoc) {
        this.tipdoc = tipdoc;
    }

    public List<Sector> getSectores() {
        return sectores;
    }

    public void setSectores(List<Sector> sectores) {
        this.sectores = sectores;
    }
    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (deposi != null ? deposi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Deposito)) {
            return false;
        }
        Deposito other = (Deposito) object;
        if ((this.deposi == null && other.deposi != null) || (this.deposi != null && !this.deposi.equals(other.deposi))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.inventario.modelo.Deposito[sttdehDeposi=" + deposi + "]";
    }

}
